﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VIP_Shop.GUI
{
    public partial class CapNhap : Form
    {
        Business_Logic.CapNhap frm;
        public CapNhap()
        {
            InitializeComponent();
            frm = new Business_Logic.CapNhap(this);
        
        }
        
         private void CapNhap_Load(object sender, EventArgs e)
        {
           
            frm.Load();
            string image = this.txthinh.Text;
            frm.loadImage(pictureBox1, image);
             
        }

        private void button1_Click(object sender, EventArgs e)
        {
            frm.Insert();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            frm.Update();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            frm.Count();
        }

        private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
        {
            frm.RowsAdded();
        }

        private void button2_Click(object sender, EventArgs e)
        {
           // MessageBox("Bạn có muốn xóa không?")
            frm.Delete();
        }

        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            frm.RowsRemoved();
        }

        private void txthinh_TextChanged(object sender, EventArgs e)
        {
            string image = this.txthinh.Text;
            frm.loadImage(pictureBox1, image);
        }

        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            frm.Count();
        }

        

    }
}
